home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 22
/
Amiga Format AFCD22 (Jan 1998, Issue 106).iso
/
-seriously_amiga-
/
shareware
/
programming
/
blitz
/
asldemo
/
asldemo.txt
< prev
next >
Wrap
Text File
|
1997-11-17
|
5KB
|
148 lines
;
; ASL FontRequester and ScreenRequester Demo
; (c) 1997 Ott M. Aaloe (ott@lbi.ee)
;
; Both requesters have many tags and orignal blitz
; commands just won't use them - so this example supports more
; tags. Note that not all tags are included. There are
; tons of them but I included only the ones I needed
; a the time...most importantly the default settings can now be
; set to a requester. And if you need some more tags then check out
; the C INCLUDE files or mail me and I could find them for you!
; Oh and you shoud have blitzlibs:amigalibs.res resident!
;
; Feel free to use any part of this code anywhere you want!
NEWTYPE.SMode
DisplayID.l
DisplayWidth.l
DisplayHeight.l
DisplayDepth.w
OverscanType.w
End NEWTYPE
NEWTYPE.FntRequester
tmp1.l ; UBYTE fo_Reserved0[8];
tmp2.l
ta_Name.l
ta_YSize.w ;/* Returned TextAttr */
ta_Style.b
ta_Flags.b
fo_FrontPen.b ; /* Returned front pen */
fo_BackPen.b ; /* Returned back pen */
End NEWTYPE
#ASLSM_Window=$80080002 ; /* Parent Window */
#ASLSM_Screen=$80080028 ; /* Screen To open On If no Window */
#ASLSM_InitialLeftEdge=$80080003 ; /* Initial requester coordinates */
#ASLSM_InitialTopEdge=$80080004 ;
#ASLSM_InitialWidth=$80080005 ; /* Initial requester dimensions */
#ASLSM_InitialHeight=$80080006
#ASLSM_InitialDisplayID=$80080064 ; /* Initial display mode id */
#ASLSM_InitialDisplayWidth=$80080065 ; /* Initial display width */
#ASLSM_InitialDisplayHeight=$80080066 ; /* Initial display height */
#ASLSM_InitialDisplayDepth=$80080067 ; /* Initial display Depth */
#ASLSM_InitialOverscanType=$80080068 ; /* Initial Type of overscan */
#ASLSM_InitialInfoOpened=$8008006a ; /* Info wndw initially opened? */
#ASLSM_InitialInfoLeftEdge=$8008006b ; /* Initial Info Window coords. */
#ASLSM_InitialInfoTopEdge=$8008006c
#ASLSM_DoWidth=$8008006d ; /* Display Width gadget? */
#ASLSM_DoHeight=$8008006e ; /* Display Height gadget? */
#ASLSM_DoDepth=$8008006f ; /* Display Depth gadget? */
#ASLSM_DoOverscanType=$80080070 ; /* Display Overscan Type gadget? */
#ASLFO_Window=$80080002 ; /* Parent Window */
#ASLFO_Screen=$80080028 ; /* Screen To open On If no Window */
#ASLFO_InitialLeftEdge=$80080003 ; /* Initial requester coordinates */
#ASLFO_InitialTopEdge=$80080004
#ASLFO_InitialWidth=$80080005 ; /* Initial requester dimensions */
#ASLFO_InitialHeight=$80080006
#ASLFO_InitialName=$8008000a ; /* Initial contents of Name gadget */
#ASLFO_InitialSize=$8008000b ; /* Initial contents of Size gadget */
#ASLFO_InitialFrontPen=$8008000e ; /* Initial front pen */
#ASLFO_DoFrontPen=$8008002c ; /* Display Front color selector? */
#ASLFO_MinHeight=$80080010 ; /* Minimum font height To display */
#ASLFO_MaxHeight=$80080011 ; /* Maximum font height To display */
#ASLFO_MaxFrontPen=$80080042 ; /* Max # of colors in front Palette */
Dim SMRtags.TagItem(16)
Dim FNTtags.TagItem(12)
SMRtags(0)\ti_Tag=#ASLSM_InitialLeftEdge,10
SMRtags(1)\ti_Tag=#ASLSM_InitialTopEdge,10
SMRtags(2)\ti_Tag=#ASLSM_InitialWidth,300
SMRtags(3)\ti_Tag=#ASLSM_InitialHeight,200
SMRtags(4)\ti_Tag=#ASLSM_InitialDisplayID,$29004
SMRtags(5)\ti_Tag=#ASLSM_InitialDisplayDepth,3
SMRtags(6)\ti_Tag=#ASLSM_InitialDisplayWidth,640
SMRtags(7)\ti_Tag=#ASLSM_InitialDisplayHeight,512
SMRtags(8)\ti_Tag=#ASLSM_InitialOverscanType,3
SMRtags(9)\ti_Tag=#ASLSM_InitialInfoOpened,1
SMRtags(10)\ti_Tag=#ASLSM_InitialInfoLeftEdge,350
SMRtags(11)\ti_Tag=#ASLSM_InitialInfoTopEdge,50
SMRtags(12)\ti_Tag=#ASLSM_DoDepth,1
SMRtags(13)\ti_Tag=#ASLSM_DoOverscanType,1
SMRtags(14)\ti_Tag=#ASLSM_DoWidth,1
SMRtags(15)\ti_Tag=#ASLSM_DoHeight,1
;
; ScreenMode requester returns the ScreenMode structure
;
*sreq.SMode=0
*sreq=AllocAslRequest_(2,&SMRtags(0)\ti_Tag)
ok.b=AslRequest_(*sreq,&SMRtags(0)\ti_Tag)
If ok<>0
NPrint "ModeID:",Hex$(*sreq\DisplayID)
NPrint "X Size:",*sreq\DisplayWidth
NPrint "Y Size:",*sreq\DisplayHeight
NPrint "Depth :",*sreq\DisplayDepth
NPrint "OScan :",*sreq\OverscanType
NPrint " "
Else
NPrint "Aborted/Error!"
EndIf
If (*sreq) Then FreeAslRequest_(*sreq)
ClickMouse
FNTtags(0)\ti_Tag=#ASLFO_InitialLeftEdge,10
FNTtags(1)\ti_Tag=#ASLFO_InitialTopEdge,10
FNTtags(2)\ti_Tag=#ASLFO_InitialWidth,350
FNTtags(3)\ti_Tag=#ASLFO_InitialHeight,300
FNTtags(4)\ti_Tag=#ASLFO_InitialName,"topaz.font"
FNTtags(5)\ti_Tag=#ASLFO_InitialSize,11
FNTtags(6)\ti_Tag=#ASLFO_InitialFrontPen,1
FNTtags(7)\ti_Tag=#ASLFO_DoFrontPen,1
FNTtags(8)\ti_Tag=#ASLFO_MinHeight,8
FNTtags(9)\ti_Tag=#ASLFO_MaxHeight,80
FNTtags(10)\ti_Tag=#ASLFO_MaxFrontPen,7
;
; Font request returns the FontRequester (!) structure
;
*fntreq.FntRequester=0
*fntreq=AllocAslRequest_(1,&FNTtags(0)\ti_Tag)
ok.b=AslRequest_(*fntreq,&FNTtags(0)\ti_Tag)
If ok<>0
NPrint "Font name:'",Peek$(*fntreq\ta_Name),"'"
NPrint "Y size :",*fntreq\ta_YSize
NPrint "Front Pen:",*fntreq\fo_FrontPen
Else
NPrint "Aborted/Error!"
EndIf
If (*fntreq) Then FreeAslRequest_(*fntreq)
ClickMouse
End